<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge，chrome=1">
    <meta name="renderer" content="webkit">
    <script src="../../../node_modules/jquery/dist/jquery.min.js"></script>
    <link rel="stylesheet" href="../../../node_modules/bootstrap/dist/css/bootstrap.min.css">
    <script src="../../../node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
    <script src="../../../node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
    <script src="../../../node_modules/vue/dist/vue.min.js"></script>
    <link rel="stylesheet" href="../../../node_modules/element-ui/lib/theme-chalk/index.css">
    <script src="../../../node_modules/element-ui/lib/index.js"></script>


    <!-- 自定义 -->
    <script src="../../../node_modules/mockjs/dist/mock.js"></script>
    <script src="../static/js/mock_config.js"></script>
    <script src="../static/js/index.js"></script>
    <link rel="stylesheet" href="../../index.css">

    <!-- PC -->
    <link rel="stylesheet" href="../static/css/HLProduction.css" media="only screen and (max-height:1600px)">
</head>

<body>
    <!--主体-->
    <div class="main clearfix" id="app">
        <div class="header">
            <header>
                <div class="navbar">
                    <div class="card_T">
                        <div class="card A" style="background-color:#0b87fa;color: white;">
                            <ul>
                                <li>
                                    <h8 style="line-height: 78px;">生产进度看板</h8>
                                </li>
                            </ul>
                        </div>
                    </div>
                    <div class="pc_content">
                        <div class="card_header">
                            <div class="card C" style="background-color: #33814e;">
                                <ul class="list-group list-group-flush">
                                    <li class="list-group-item">
                                        <h4>执行中加工任务</h4>
                                    </li>
                                    <li class="list-group-item1">
                                        <h3 id="WaitPrtQty">{{Zhi}}条</h3>
                                    </li>
                                </ul>
                            </div>
                            <div class="card C B" style=" background: #d9d916;">
                                <ul class="list-group list-group-flush">
                                    <li class="list-group-item">
                                        <h4>30天缺料</h4>
                                    </li>
                                    <li class="list-group-item1">
                                        <h3 id="Col7Qty1" style="color: white;">{{defaultDt3.length}}条</h3>
                                    </li>
                                </ul>
                            </div>
                        </div>
                        <div class="card_header">
                            <div class="card C" style=" background: #FF0000;">
                                <ul class="list-group list-group-flush">
                                    <li class="list-group-item">
                                        <h4>逾期加工任务</h4>
                                    </li>
                                    <li class="list-group-item1">
                                        <h3 id="Waitcompleted" style="color: white;">{{Quan}}条</h3>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </header>
        </div>


        <div class="main-left">
            <div class="border-container M">
                <div class="name-title">
                    本周待下达生产指示
                </div>
                <div>
                    <el-table class="aa" :data="defaultDt1" :default-sort="{prop: 'date', order: 'descending'}" stripe="true" ref="defaultDt1" :height=el_table_height1>
                        <el-table-column prop="ID"   align="center" label="序号">
                        </el-table-column>
                        <el-table-column prop="GoodsCode"  align="center" label="产品代号">
                        </el-table-column>
                        <el-table-column prop="QtySup" align="center" label="计划生产数">
                        </el-table-column>
                        <el-table-column prop="RecComSetQty"  align="center" label="当前齐套数">
                        </el-table-column>
                        <el-table-column prop="DateSup" :formatter="formatterTime" align="center" label="计划生产日">
                        </el-table-column>
                    </el-table>
                </div>
                <span class="top-left border-span"></span>
                <span class="top-right border-span"></span>
                <span class="bottom-left border-span"></span>
                <span class="bottom-right border-span"></span>
            </div>
        </div>
        <div class="center">
            <div class="border-container">
                <div class="name-title">
                    加工任务进度
                </div>
                <div>
                    <el-table :data="defaultDt2" :default-sort="{prop: 'date', order: 'descending'}" stripe="true" ref="defaultDt2" :height=el_table_height3>
                        <el-table-column prop="ID"  align="center" label="序号">
                        </el-table-column>
                        <el-table-column prop="PPT" width="180"  align="center" label="任务单号">
                        </el-table-column>
                        <el-table-column prop="GoodsCode"  align="center" label="产品代号">
                        </el-table-column>
                        <el-table-column prop="Qty" align="center"  label="完工/任务数">
                        </el-table-column>
                        <!-- <el-table-column prop="WaitQty" align="center" label="待完工数">
                        </el-table-column> -->
                        <el-table-column prop="PrtTime" align="center"   label="总工时">
                        </el-table-column>
                        <el-table-column prop="WithDate" :formatter="formatterTime" align="center" label="计划结束日">
                        </el-table-column>

                    </el-table>
                </div>
                <span class="top-left border-span"></span>
                <span class="top-right border-span"></span>
                <span class="bottom-left border-span"></span>
                <span class="bottom-right border-span"></span>
            </div>
        </div>
        <div class="main-right">
            <div class="border-container">
                <div class="name-title">
                    30天缺料
                </div>
                <div>
                    <el-table :data="defaultDt3" :default-sort="{prop: 'date', order: 'descending'}" stripe="true" :height=el_table_height2 ref="defaultDt3">
                        <el-table-column prop="ID"    align="center" label="序号">
                        </el-table-column>
                        <el-table-column prop="GoodsCode"  align="center" label="材料代号">
                        </el-table-column>
                        <el-table-column prop="QtyShort" align="center" label="30天缺料">
                        </el-table-column>
                        <el-table-column prop="UnitName" align="center" label="单位">
                        </el-table-column>
                        <!-- <el-table-column prop="DateSup" :formatter="formatterTime" align="center" label="最近供应日">
                        </el-table-column> -->
                    </el-table>
                </div>
                <span class="top-left border-span"></span>
                <span class="top-right border-span"></span>
                <span class="bottom-left border-span"></span>
                <span class="bottom-right border-span"></span>
            </div>
        </div>
    </div>

</body>

<script>
    new Vue({
        el: '#app',
        data() {
            return {
                el_table_height1: 900,
                el_table_height2: 900,
                el_table_height3: 900,
                defaultDt1: [],
                defaultDt2: [],
                defaultDt3: [],
                Zhi:0,
                Qty:0,
                Quan:0,
            }
        },
        methods: {
            GetTabelDate(that) {
                // 执行中加工任务
                GetCodeData("VB21122911001263", "Get", "Goods").then(function(res) {
                        that.Zhi=res.rows[0].Qty;
                    }),
                    //逾期加工任务
                    GetCodeData("VB21122910545559", "Get", "Goods").then(function(res) {
                        that.Quan=res.rows[0].Qty;
                    }),
                    // //30天缺料
                    // GetCodeData("", "Get", "Goods").then(function(res) {

                    // }),
                    //本周待执行生产指示
                    GetCodeData("VB21122910431136", "Get", "Goods").then(function(res) {
                        that.defaultDt1 = res.rows
                    }),
                    //加工任务进度
                    GetCodeData("VB21122910503938", "Get", "Goods").then(function(res) {
                        that.defaultDt2 = res.rows
                    }),
                    //30天缺料
                    GetCodeData("VB21122911385448", "Get", "Goods").then(function(res) {
                        that.defaultDt3 = res.rows
                    })
            },
            formatterTime(row, column) {
                let data = row[column.property]
                return /\d{4}-\d{1,2}-\d{1,2}/g.exec(data)
            }
        },

        mounted() {
            TableAotoRoll([this.$refs.defaultDt1, this.$refs.defaultDt2, this.$refs.defaultDt3])
            var that = this
            setTimeout(function() {
                that.GetTabelDate(that)
            }, 0);
            setInterval(function() {
                that.GetTabelDate(that)
            }, 1000 * 60);
        }
    })
</script>



</html>